package org.jeecg.modules.bigdatashow.service.impl;

import org.jeecg.modules.bigdatashow.entity.Common;
import org.jeecg.modules.bigdatashow.entity.TsMonth;
import org.jeecg.modules.bigdatashow.mapper.MonthMapper;
import org.jeecg.modules.bigdatashow.service.MonthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MonthServiceImpl implements MonthService {
    @Autowired
    private MonthMapper monthMapper;
    @Override
    public List<Common> findVisitorMonth() {
        return monthMapper.findVisitorMonth();
    }

    @Override
    public List<TsMonth> findTsMonth() {
        //从游客表中获取到团队和散客信息
        Integer team = monthMapper.getTvisitor();
        Integer scatter = monthMapper.getSvisitor();
        System.out.println(team);
        System.out.println(scatter);
        //对月份游客表进行更新
        monthMapper.updateVisitor(team,scatter);
        return monthMapper.findTsMonth();
    }

    @Override
    public List<TsMonth> findAllTsMonth() {
        return monthMapper.findAllTsMonth();
    }
}
